package com.ruoyi.system.service.impl.config;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.config.VsDramasBlockMapper;
import com.ruoyi.system.domain.config.VsDramasBlock;
import com.ruoyi.system.service.config.IVsDramasBlockService;

/**
 * 轮播图Service业务层处理
 * 
 * @author zzx
 * @date 2024-05-22
 */
@Service
public class VsDramasBlockServiceImpl implements IVsDramasBlockService 
{
    @Autowired
    private VsDramasBlockMapper vsDramasBlockMapper;

    /**
     * 查询轮播图
     * 
     * @param id 轮播图主键
     * @return 轮播图
     */
    @Override
    public VsDramasBlock selectVsDramasBlockById(Integer id)
    {
        return vsDramasBlockMapper.selectVsDramasBlockById(id);
    }

    /**
     * 查询轮播图列表
     * 
     * @param vsDramasBlock 轮播图
     * @return 轮播图
     */
    @Override
    public List<VsDramasBlock> selectVsDramasBlockList(VsDramasBlock vsDramasBlock)
    {
        return vsDramasBlockMapper.selectVsDramasBlockList(vsDramasBlock);
    }

    /**
     * 新增轮播图
     * 
     * @param vsDramasBlock 轮播图
     * @return 结果
     */
    @Override
    public int insertVsDramasBlock(VsDramasBlock vsDramasBlock)
    {
        vsDramasBlock.setCreatetime(System.currentTimeMillis());
        vsDramasBlock.setUpdatetime(System.currentTimeMillis());
        return vsDramasBlockMapper.insertVsDramasBlock(vsDramasBlock);
    }

    /**
     * 修改轮播图
     * 
     * @param vsDramasBlock 轮播图
     * @return 结果
     */
    @Override
    public int updateVsDramasBlock(VsDramasBlock vsDramasBlock)
    {
        vsDramasBlock.setUpdatetime(System.currentTimeMillis());
        return vsDramasBlockMapper.updateVsDramasBlock(vsDramasBlock);
    }

    /**
     * 批量删除轮播图
     * 
     * @param ids 需要删除的轮播图主键
     * @return 结果
     */
    @Override
    public int deleteVsDramasBlockByIds(Integer[] ids)
    {
        return vsDramasBlockMapper.deleteVsDramasBlockByIds(ids);
    }

    /**
     * 删除轮播图信息
     * 
     * @param id 轮播图主键
     * @return 结果
     */
    @Override
    public int deleteVsDramasBlockById(Integer id)
    {
        return vsDramasBlockMapper.deleteVsDramasBlockById(id);
    }
}
